{template header}

<script type="text/javascript">

function check_code(){
	var code=$.trim($('#code').val());
	$.post("index.php?c=user&a=ajaxcode",{code: code}, function(flag){
		if(1==flag){
		   	$('#codetip').html("<font color='green'>OK</font>");
		 }else{
			$('#codetip').html("<font color='red'>验证码不匹配！</font>");
			codeok=0;
		 }
	});
}


</script>
<div id="content">
	<div  id="loginForm">
		<div class="block">
		<div class="title"><h3>注册新用户</h3></div>

		<div class="tips">
			<ul>
		      <li>如果还没有注册，请点此“<a href="index.php?c=user&a=register">注册</a>”。</li>
		      <li>忘记密码了？请点击“<a href="index.php?c=user&a=getpass">找回密码</a>”。</li>
		  </ul>
		</div>
		
		<form name="loginform"  action="index.php?c=user&a=login" method="post" >
		<div class="formItem">
		<ul>
		
			<li>
				用户名：<input type="text" size="42"  maxlength="18"  class="l_input js_login_email" id="username" name="username">
				<span id="usernametip"></span>
			</li>

	      	<li>
				密&nbsp;&nbsp;码：<input type="password" size="42" maxlength="16" class="l_input" id="password" name="password" >
				<span id="passwordtip"></span>
	      	</li>

			<!--{if $setting['code_login']}-->
				<li>
					验证码：<input type="text" size="10"  maxlength="4" id="code" name="code" onblur="check_code()" />
					<img id="verifycode" onclick="javascript:updatecode();" src="index.php?c=user&a=code"/>&nbsp;
					<span id="codetip"><a href="javascript:updatecode();">看不清，换一个</a></span>
				</li>
			<!--{/if}-->

			<li class="btns">
				<input name="forward" type="hidden" id="forward" value="{$forward}">
				<input type="submit" value="登&nbsp;&nbsp;录" name="submit" class="btn">
			</li>
			
		</ul>
		</div>
		</form>
	</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
	if(!$("#username").val()){
        $("#username").focusText("请输入用户名或邮箱地址或手机号码");
    }else{
        $("#username").addClass("i_active");
    }
    
  	$("#username").blur(function(){ 
		var self = $(this);
        if(self.val() === '' || self.val() === '请输入用户名或邮箱地址或手机号码'){
            $('#usernametip').html("<font color='red'>请输入用户名或邮箱地址或手机号码！</font>");
        }else{
            $('#usernametip').html("");
        }
  	}); 
});
</script>
{template footer}